package com.xcesys.extras.dataobject.system;

import java.util.Collection;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

import com.xcesys.extras.dataobject.EditableObject;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CodeType")
public class CodeType extends EditableObject {

	private static final long serialVersionUID = 5084916466002291707L;

	private Collection<CodeList> codeLists = null;

	private String description;

	private Integer lenLimit;

	private String name;

	public CodeType() {
	}

	public Collection<CodeList> getCodeLists() {
		return this.codeLists;
	}

	public String getDescription() {
		return description;
	}

	public Integer getLenLimit() {
		return this.lenLimit;
	}

	public String getName() {
		return this.name;
	}

	public void setCodeLists(Collection<CodeList> tcSysCodeLists) {
		this.codeLists = tcSysCodeLists;
	}

	public void setDescription(String description) {
		Object oldValue = this.description;
		this.description = description;
		firePropertyChange("description", oldValue, description);
	}

	public void setLenLimit(Integer codeLenLimit) {
		this.lenLimit = codeLenLimit;
	}

	public void setName(String codeTypeNameE) {
		this.name = codeTypeNameE;
	}

	/**
	 * Constructs a <code>String</code> with all attributes in name = value
	 * format.
	 * 
	 * @return a <code>String</code> representation of this object.
	 */
	@Override
	public String toString() {
		final String TAB = "    ";

		String retValue = "";

		retValue = "CodeType ( " + super.toString() + TAB + "codeLists = "
				+ this.codeLists + TAB + "codeType = " + "lenLimit = "
				+ this.lenLimit + TAB + "name = " + this.name + TAB + " )";

		return retValue;
	}

}
